package com.mvp.dagger.translate.di.module;

import android.content.Context;
import android.content.SharedPreferences;

import com.mvp.dagger.translate.MainActivity;
import com.mvp.dagger.translate.bean.TranslateResult;
import com.mvp.dagger.translate.di.scope.ActivityScope;

import dagger.Module;
import dagger.Provides;

@Module
public class MainActivityModule {

    @Provides
    static String provideName() {
        return MainActivity.class.getName();
    }

    @Provides
    static SharedPreferences provideSp(MainActivity activity) {
        return activity.getSharedPreferences("def", Context.MODE_PRIVATE);
    }

    @Provides
    @ActivityScope
    static TranslateResult provideTranslate() {
        return new TranslateResult();
    }
}
